# Oracle数据库不支持migration!
defmodule IocpMonitor.Repo.Migrations.CreateIocpLog do
  use Ecto.Migration

  def change do
    create table(:iocp_log, comment: "电流盒子实时数据日志") do
      add :device_address, :integer, comment: "设备地址"
      add :observed_at, :timestamptz, comment: "观测时间戳"
      add :voltage, :integer, comment: "电压（0.1V）"
      add :amperage, :integer, comment: "电流（0.01A）"
      add :power, :integer, comment: "视在功率（0.1W）"
      add :consumption, :integer, comment: "电度（0.1度）"
      add :overcurrent1, :boolean, comment: "过流一段"
      add :overcurrent2, :boolean, comment: "过流二段"
      add :overvoltage, :boolean, comment: "过压"
      add :undervoltage, :boolean, comment: "欠压"
    end
  end
end
